/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package com.isd.global.modelo;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.EmbeddedId;
import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.Lob;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 *
 * @author ctrosch
 */
@Entity
@Table(name = "USR_TVVIDEOS")
public class ItemVideo implements Serializable {
    private static final long serialVersionUID = 1L;
    @EmbeddedId
    protected ItemVideoPK itemVideoPK;

    @Column(name = "USR_TVVIDEOS_NORDEN", insertable=false, updatable=false)
    private int orden;

    @Basic(optional = false)
    @Column(name = "USR_TVVIDEOS_DESCRP", nullable = false, length = 60)
    private String descripcion;

    @ManyToOne
    @JoinColumn(name = "USR_TVVIDEOS_TVCONF_ID", referencedColumnName = "USR_TVCONF_ID", nullable = false, insertable=false, updatable=false)
    private Parametro parametro;

    @Lob
    @Column(name = "USR_TVVIDEOS_LINK", length = 2147483647)
    private String link;
    @Column(name = "USR_TVVIDEOS_SUGERE", length = 60)
    private String segerencia;
    @Column(name = "USR_TVVIDEOS_ACTIVO")
    private Character activo;
    @Column(name = "USR_TVVIDEOS_TITULO", length = 80)
    private String titulo;
    
    @Column(name = "USR_TV_DEBAJA")
    private Character debaja;
    
    public ItemVideo() {
    }

    public ItemVideo(ItemVideoPK itemVideoPK) {
        this.itemVideoPK = itemVideoPK;
    }

    public ItemVideo(ItemVideoPK itemVideoPK, String usrTvvideosDescrp) {
        this.itemVideoPK = itemVideoPK;
        this.descripcion = usrTvvideosDescrp;
    }

    public ItemVideo(short usrTvvideosTvconfId, short usrTvvideosNorden) {
        this.itemVideoPK = new ItemVideoPK(usrTvvideosTvconfId, usrTvvideosNorden);
    }

    public int getOrden() {
        return orden;
    }

    public void setOrden(int orden) {
        this.orden = orden;
    }
    
    public Character getActivo() {
        return activo;
    }

    public void setActivo(Character activo) {
        this.activo = activo;
    }

    public Character getDebaja() {
        return debaja;
    }

    public void setDebaja(Character debaja) {
        this.debaja = debaja;
    }

    public String getDescripcion() {
        return descripcion;
    }

    public void setDescripcion(String descripcion) {
        this.descripcion = descripcion;
    }

    public ItemVideoPK getItemVideoPK() {
        return itemVideoPK;
    }

    public void setItemVideoPK(ItemVideoPK itemVideoPK) {
        this.itemVideoPK = itemVideoPK;
    }

    public String getLink() {
        return link;
    }

    public void setLink(String link) {
        this.link = link;
    }

    public Parametro getParametro() {
        return parametro;
    }

    public void setParametro(Parametro parametro) {
        this.parametro = parametro;
    }

    public String getSegerencia() {
        return segerencia;
    }

    public void setSegerencia(String segerencia) {
        this.segerencia = segerencia;
    }

    public String getTitulo() {
        return titulo;
    }

    public void setTitulo(String titulo) {
        this.titulo = titulo;
    }
    
    @Override
    public int hashCode() {
        int hash = 0;
        hash += (itemVideoPK != null ? itemVideoPK.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof ItemVideo)) {
            return false;
        }
        ItemVideo other = (ItemVideo) object;
        if ((this.itemVideoPK == null && other.itemVideoPK != null) || (this.itemVideoPK != null && !this.itemVideoPK.equals(other.itemVideoPK))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "tv.global.modelo.ItemVideo[itemVideoPK=" + itemVideoPK + "]";
    }

}
